package utilities;

import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;

public class RemoteUserData 
{
    static public boolean isMobileNativeClient(HttpServletRequest httpRequest)
    {
        Enumeration headerNames = httpRequest.getHeaderNames();
        String headerName = "";
        String userAgent = "";
        final String mAndroidMobileUserAgent = "gamerswebWebView-1.0";

        while (headerNames.hasMoreElements())
        {
            headerName = (String)headerNames.nextElement();
            if (headerName.equalsIgnoreCase("user-agent"))
            {
                userAgent = httpRequest.getHeader(headerName);
                if (userAgent.equalsIgnoreCase(mAndroidMobileUserAgent))
                {
                    return true;
                }
            }
        }
        return false;
    }    
}
